//
//  UIImage+JJ.m
//  Travel assistant
//
//  Created by lanou3g on 16/3/1.
//  Copyright © 2016年 旅游助手. All rights reserved.
//

#import "UIImage+JJ.h"

@implementation UIImage (JJ)
+ (UIImage *)imageWithName:(NSString *)name
{
    if (1) {
        NSString *newName = [name stringByAppendingString:@"_os7"];
        UIImage *image = [UIImage imageNamed:newName];
        if (image == nil) {
            image = [UIImage imageNamed:name];
        }
        return image;
    }
    return [UIImage imageNamed:name];
}

+ (UIImage *)resizedImageWithName:(NSString *)name
{
    UIImage *image = [self imageNamed:name];
    return [image stretchableImageWithLeftCapWidth:image.size.width * 0.5 topCapHeight:image.size.height * 0.5];
}


@end
